
#ifndef  ONEDIRECTIONLIST_H
#define  ONEDIRECTIONLIST_H

#include "Util.h"

class OneDirectionList : public util::Task {
public:
    struct Node {
        explicit Node(const int val) : val(val), next(nullptr){}
        int val;
        struct Node * next;
    };

    OneDirectionList();
    ~OneDirectionList() override;

    void run() override ; 

    void print();
    void reversePrint();

private:
    void init();
    void deinit();

    void reversePrint(struct Node * node);

private:
    struct Node * head;
};

#endif   /* ONEDIRECTIONLIST_H */
